Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[webgpu]Add MaxPool and AveragePool #23714

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jchen10
Copy link
Contributor

@jchen10 jchen10 commented Feb 15, 2025

This adds Max and Average pool operators for webgpu-native. Basically, this is a rewrite of the corresponding JSEP operators with some improvements:

  1. 'dilations' support
  2. Pooling with kernelShape.length > 2 for NHWC format
  3. code cleanup

However, there are still a few missing features:

  1. ceil 'ceil_mode'
  2. column major 'storage_order'
  3. 'Indices' output for Max pools.

@jchen10
Copy link
Contributor Author

jchen10 commented Feb 15, 2025

5 cases fail running onnxruntime_test_all.exe --gtest_filter=PoolTest*:

[  FAILED  ] 5 tests, listed below:
[  FAILED  ] PoolTest.MaxPool_8_With_Index
[  FAILED  ] PoolTest.MaxPool1D_8_With_Index
[  FAILED  ] PoolTest.MaxPool_10_Dilation_Ceil1_2d
[  FAILED  ] PoolTest.AveragePool_10_ceil1_2d
[  FAILED  ] PoolTest.MaxPoolDimWithZeroForN

MaxPoolDimWithZeroForN failure is caused by a bug in 'Transpose' operator, and can be fixed without much difficulty.
Other cases are because of the missing features, which are also missing in JSEP. Can we just disable the cases for webgpu-native? Not sure how much efforts needed to fully support them.

@jchen10
Copy link
Contributor Author

jchen10 commented Feb 15, 2025

@fs-eire @guschmue @xhcao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant